<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
						<input id="id" name="id" th:value="${deviceExample.id}"  type="hidden">
							<div class="form-group">	
								<label class="col-sm-3 control-label">设备号：</label>
								<div class="col-sm-8">
									<input id="deviceSn" readonly name="deviceSn" th:value="${deviceExample.deviceSn}" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">外键设备表：</label>
								<div class="col-sm-8">
									<!--查询设备名称-->
									<select id="deviceType" name="deviceType" class="form-control">
										<option th:each="list:${hardWareList}" th:selected="${list.id==deviceExample.deviceType}" th:value="${list.id}"  th:text="${list.name}"></option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">设备状态</label>
								<div class="col-sm-8">
									<!-- 0正常 1维修 2报损：-->
									<select id="deviceState" name="deviceState" class="form-control" >
										<option th:field="*{deviceExample.deviceState}" value="0">正常</option>
										<option th:field="*{deviceExample.deviceState}" value="1">维修</option>
										<option th:field="*{deviceExample.deviceState}" value="2">报损</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">位置id 外键：</label>
								<div class="col-sm-8">
									<input id="locationId" readonly name="locationId" th:value="${deviceExample.locationId}" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">备注信息：</label>
								<div class="col-sm-8">
									<input id="remarks" name="remarks" th:value="${deviceExample.remarks}" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">数据类型</label>
								<div class="col-sm-8">
									<!-- 0 床垫 1gps 2网关设备 3网关刷卡：-->
									<select id="behaviorType" name="behaviorType" class="form-control">
										<option value="" style="display: none">请选择</option>
										<option th:field="*{deviceExample.behaviorType}"  value="0">床垫</option>
										<option th:field="*{deviceExample.behaviorType}"   value="1">GPS</option>
										<option th:field="*{deviceExample.behaviorType}"   value="2">网关设备</option>
										<option th:field="*{deviceExample.behaviorType}"   value="3">网关刷卡</option>
									</select>
								</div>
							</div>
							<hr/>
							<!--进行数据显示device_binding_rela数据结构-->
							<div id="proBox">
								<div class="form-group" th:each="relaList:${deviceBindingRelaList}">
									<!--<div th:each="list:${list}">&lt;!&ndash;添加此div目的是数据回显&ndash;&gt;-->
									<label class="col-sm-3 control-label" th:text="${relaList.bidingTypes==0?'网关':(relaList.bidingTypes==1?'老人':(relaList.bidingTypes==2?'家庭':'场景'))}+'设备'"></label>
									<div class="col-sm-8">
										<select  th:name="${relaList.bidingTypes}" class="form-control">
											<option value="" >请选择功能名称</option>
											<option th:each="bindingDTO:${relaList.bindingDTOList}" th:selected="${bindingDTO.checked=='0'}" th:value="${bindingDTO.id}" th:text="${bindingDTO.name}"></option>
										</select>
									</div>
									</div>
								<!--</div>-->
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/equipment/deviceExample/edit.js">
	</script>

</body>
</html>
